package com.tfswx.jcyw.ruleenginedesigner.api.third;

import com.tfswx.jcyw.ruleenginedesigner.bean.ApiResult;
import com.tfswx.jcyw.ruleenginedesigner.bean.Sjy;
import com.tfswx.jcyw.tyyw.dto.WsmbSjyFindInputDTO;
import com.tfswx.jcyw.tyyw.service.TyywkzService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.NonNull;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Ricky
 * @date 2021/6/20
 */
@RestController
@RequestMapping("/sjygl")
@Api(tags = "内置三方数据源")
public class ThirdSjyController {

    @Resource
    private TyywkzService tyywkzService;

    @ApiOperation(value = "统一业务文书", notes = "获取统一业务文书编码")
    @PostMapping("/findWsXtMbByLibraryAndYwbm")
    public ApiResult<Sjy> findWsmbSjy(@NonNull @RequestBody @Validated WsmbSjyFindInputDTO wsmbSjyFindInputDTO) {
        Sjy sjy = tyywkzService.findWsmbSjy(wsmbSjyFindInputDTO);
        return ApiResult.success(sjy);
    }

}
